package com.irenty;

import java.util.Map;
import java.util.TreeMap;

public class AlgInfo {
	private String name;
	private Sort<Integer> impl;
	private Map<Integer, Long> metrics = new TreeMap<Integer, Long>();
	
	public AlgInfo(String name, Sort<Integer> impl) {
		this.name = name;
		this.impl = impl;
	}
	
	public void addMetric(Integer size, Long time) {
		metrics.put(size, time);
	}
	public Long getMetric(Integer size) {
		return metrics.get(size);
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setImpl(Sort<Integer> impl) {
		this.impl = impl;
	}
	public Sort<Integer> getImpl() {
		return impl;
	}
	
	@Override
	public String toString(){
		StringBuilder sb = new StringBuilder(this.name);
		
		for (Integer size : this.metrics.keySet()) {
			sb.append("\n");
			sb.append(size);
			sb.append(" : ");
			sb.append(this.metrics.get(size));
		}
		return sb.toString();
	}
}
